<template>
	<view class="content">
		<!-- <image class="img1" src="@/static/img/bg_2.png" mode="widthFix"></image>
		<image class="img2" src="@/static/img/bg_1.png" mode="widthFix"></image> -->
		<image class="img2" src="@/static/img/down_img.png" mode="widthFix"></image>
		<image v-if="show" class="img3" src="@/static/img/hint.png" mode="widthFix"></image>
		<view class="btns">
			<image src="@/static/img/down.png" mode="widthFix"></image>
			<a :href="downUrl">下载APP</a>
			<!-- <a >下载APP</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				downUrl: '',
				show: false
			}
		},
		onLoad() {
			uni.request({
				url: 'https://p2papi.gratls.com.cn/127', //服务器请求更新信息地址
				method: 'POST',
				success: (srcData) => {
					console.log(121212, srcData.data.data);
					this.downUrl = srcData.data.data.androidUrl
				}
			})
			const userAgent = window.navigator.userAgent.toLowerCase();
			console.log(userAgent);
			console.log(userAgent.match(/MicroMessenger/));
			if (userAgent.match(/MicroMessenger/i) == 'micromessenger') {
				this.show = true; // 微信中打开
			} else {
				this.show = false; // 普通浏览器中打开
			}
			// if (userAgent.indexof('micromessenger') !== -1) {
			// 	// 在微信中打开，显示遮罩层
			// 	this.show = true;
			// }
		}
	}
</script>


<style scoped lang="scss">
	.content {
		/* background: white; */
		width: 100vw;
		height: 100vh;
		// overflow: hidden;
		// padding-top: 280rpx;
		// background: url('@/static/img/bg_2.png') no-repeat;
		position: relative;
	}

	.img1 {
		width: 100vw;
		position: absolute;
		left: 0;
		bottom: 0;
	}

	.img2 {
		width: 100vw;
		position: absolute;
		left: 0;
		top: 0;
	}

	.img3 {
		width: 244rpx;
		position: fixed;
		right: 30rpx;
		top: 0;
	}

	.btns {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 560rpx;
		height: 100rpx;
		position: fixed;
		bottom: 100rpx;
		margin: 0 95rpx;
		background: linear-gradient(to right, #FF5F3B 0%, #FF524F 100%);
		border-radius: 60rpx;
		font-weight: 500;
		font-size: 36rpx;
		color: #FFFFFF;

		image {
			width: 48rpx;
			margin-right: 20rpx;
		}

		a {
			color: white;
			text-decoration: none;
		}
	}
</style>